Conventionally, communication devices that perform interrupt control in IP communication and the like have been provided.
FIG. 17 is a block diagram illustrating a structure of a general communication device that performs interrupt control.
In general, a communication device 2000 includes, as illustrated in FIG. 17, structural elements which are a communication processing apparatus 2201, a main memory 2102, a Control Processing Unit (CPU) 2103, and the like. The structural elements are connected to one another via a system bus 2202. Operations of the structural elements are controlled by software executed on the CPU 2103.
It is common that the communication processing apparatus 2201 included in such communication device 2000 has an interrupt function. The interrupt function is realized by outputting signals (interrupt signals) from the communication processing apparatus 2201 to the CPU 2103. The interrupt function makes it possible to immediately notify the CPU 2103 with various events occurred in the communication processing apparatus 2201, and speedily execute the corresponding processing by software. The events include, for example, receiving of communication data (packets), completion of packet transmission, occurrence of abnormal conditions, and the like.
Conventionally, there are some methods for outputting an interrupt signal caused by receipt of a packet. The first method is a method of outputting an interrupt signal for each receipt of packet. The second method is a method of continuing outputting interrupt signals after the communication processing apparatus 2201 receives packets until no more packet out of the management of the communication processing apparatus 2201 is left in the communication processing apparatus 2201 due to software execution. By the second method, as long as there is any received packet under the management of the communication processing apparatus 2201, interrupts occur to the software (the software temporarily stops the interrupts so as to continue the original processing). Furthermore, as the third method, there is a method (delay interrupt) of outputting an interrupt signal to be delayed by a predetermined time from a timing of packet receipt of the communication processing apparatus 2201, as seen in DP83816 of National Semiconductor™. The delay interrupt is useful as a method of reducing a software processing amount caused by the interrupt, in the situation where short packets are frequently received, for example. On the other hand, there is also proposed that, in order to reduce such a software processing amount caused by interrupts, the state of the communication processing apparatus 2201 is regularly monitored and controlled by using a timer function which an Operation System (OS) as basic software has, without using the interrupt function for receipt processing. However, this timer function by software has a rough accuracy (on the order of several dozens msec), and the timer function itself increases the software processing amount. Therefore, the method is not always preferred for CPUs in home electronics having low CUP processing performance. In addition, since packet receipt is an event caused by the outside, the timer function should be always effective to allow the time function to check packet receipt of the communication processing apparatus 2201. This increases unnecessarily a software processing amount.
Meanwhile, it is common that a plurality of packets received by the communication processing apparatus 2201 include packets belonging to various application programs (hereinafter, referred to simply as an application). Especially when general-purpose IP communication is used, packets belonging to applications using different session protocols such as HyperText Transfer Protocol (HTTP), File Transfer Protocol (FTP), and Simple Mail Transfer Protocol (SMTP)/Post Office Protocol (POP) 3 (mail function) are mixed. Even using the same HTTP, processing of the applications vary from Web browsing to video streaming. Therefore, various factors are sometimes mixed regarding amounts and immediacy of received packets. Moreover, when Transmission Control Protocol (TCP) is used as a Transport layer, a throughput that is transfer performance is affected by processing is delay between transfer terminals. It is therefore preferable that Acknowledgment (ACK) receipt that is acknowledgment is processed earlier.
As described above, since various factors are mixed for received packets handled by a single communication processing apparatus 2201, a communication device that classifies received packets in the communication processing apparatus 2201 to be managed and thereby makes processing of software easy is proposed (for example, see Patent Reference 1).
The communication device disclosed in the above-mentioned Patent Reference 1 uses Rings each unique to a corresponding packet classification, while a transfer control unit, which will be described later in detail, uses transfer management descriptors (Descriptors) to manage and control received packets. In the communication device of the Patent Reference 1, general-purpose hierarchy processing such as processing of Transmission Control Protocol (TCP)/Internet Protocol (IP) stacks is not performed for received packets transferred to the main memory, and each application directly handles the above-mentioned Ring. As a result, the communication device of the Patent Reference 1 can reduce a number of processes of copying the received packets in the main memory.
FIG. 18 is a block diagram for comparing the communication device 2000 of the above-described Patent Reference 1 to the present invention. The communication processing apparatus 2201 in the communication device 2000 of the above-described Patent Reference 1 includes a transfer control unit 2304, a transmission data holding unit 2105, a MAC unit 2106, a classification unit 2107, a classification table 2108, a received-data holding unit 2109, a setting unit 2310, and a interrupt control unit 2311.
In transmission processing, the transfer control unit 2304 transfers data of a to-be-transmitted packet to the transmission data holding unit 2105, managing and controlling packet data transfer between the communication processing apparatus 2201 and the main memory 2102. Furthermore, for receipt processing, the transfer control unit 2304 transfers data of a received packet from the received-data holding unit 2109 to the main memory 2102. The transmission data holding unit 2105 transfers the data of the to-be-transmitted packet transferred from the transfer control unit 2304, to the MAC unit 2106. The MAC unit 2106 performs transmission processing compliant with a predetermined Media Access Control (MAC) standard for the data of the to-be-transmitted packet transferred from the transmission data holding unit 2105. In addition, the MAC unit 2106 performs receipt processing compliant with the predetermined MAC standard for the data of the received packet, and transfers the data to the classification unit 2107. Here, external blocks connected with the MAC unit 2106 depend on a physical layer. They are interfaces (I/F) connected to a network connected to the communication device 2000.
The classification unit 2107 classifies the data of the received packet transferred from the MAC unit 2106 with reference to the classification table 2108, and thereby transfers the data together with classification information to the received-data holding unit 2109. The received-data holding unit 2109 holds the data of the received packet transferred from the classification unit 2107 and the classification information in association with each other. For receipt processing, the transfer control unit 2304 transfers the data of the received packet which is held in the received-data holding unit 2109 to the main memory 2102 based on the associated classification information. Here, the transfer control unit 2304 notifies the interrupt control unit 2311 of the fact that the data of the received packet has been transferred to the main memory 2102, and the interrupt control unit 2311 thereby outputs an interrupt signal to the CPU 2103 according to the notification from the transfer control unit 2304. In addition, the setting unit 2310 receives a setting change request for the classification table 2108 which is issued from the CPU 2103, and thereby changes the classification table 2108.
Moreover, there is also proposed a communication device that controls interrupt of packet receipt by using a method depending on a type of the received packet (for example, see Patent Reference 2). The communication device disclosed in the Patent Reference 2 analyzes a type of each received packet, thereby determines whether or not the received packet is a real-time packet, and transfers the received packet to a buffer. If it is determined that the received packet is a real-time packet, the communication device immediately outputs an interrupt signal to a CPU. On the other hand, if it is determined that the received packet is not a real-time packet, the communication device outputs an interrupt signal to the CPU after a predetermined time has passed since the packet receipt or after a predetermined amount of data has been accumulated in the buffer. In short, the communication device of the above-described Patent Reference 2 switches an interrupt control method for each received packet depending on a type of the received packet.